package com.jims.master.modules.sync.service; /**
 * jims
 */
import com.jims.master.common.persistence.Page;
import com.jims.master.common.service.CrudService;
import com.jims.master.common.web.impl.BaseDto;
import com.jims.master.modules.sync.dao.TransferRecordDao;
import com.jims.master.modules.sync.entity.ClinicMaster;
import com.jims.master.modules.sync.entity.TransferRecord;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * 转诊记录Service
 * @author ct
 * @version 2017-12-14
 */
@Service
@Transactional(readOnly = true)
public class TransferRecordService extends CrudService<TransferRecordDao, TransferRecord> {

	public TransferRecord get(String id) {
		return super.get(id);
	}
	
	public List<TransferRecord> findList(TransferRecord transferRecord) {
		return super.findList(transferRecord);
	}
	
	public Page<TransferRecord> findPage(Page<TransferRecord> page, TransferRecord transferRecord) {
		return super.findPage(page, transferRecord);
	}
	
	@Transactional(readOnly = false)
	public int save(TransferRecord transferRecord) {
		return super.save(transferRecord);
	}
	
	@Transactional(readOnly = false)
	public int delete(TransferRecord transferRecord) {
		return super.delete(transferRecord);
	}

	/**
	 * 得到转诊表中最新同步时间
	 * @author ct
	 * @return
	 */
	public String getMaxTime(){
		return dao.getMaxTime();
	}

	/**
	 * 同步转诊信息
	 * @param list
	 * @author ct
	 * @return
	 */
	@Transactional(readOnly = false)
	public int insertTransfer(List<BaseDto> list){
		return  dao.insertTransfer(list);
	}

	/**
	 * 转诊统计图
	 * @author ct
	 * @return
	 */
	public List<TransferRecord> transferColumn(){
		return dao.transferColumn();
	}

	public List<TransferRecord> getBaseByDoctor(String doctorId){
		return dao.getBaseByDoctor(doctorId);
	}

	public TransferRecord getByClinic(String outClinic){
		return dao.getByClinic(outClinic);
	}

	public List<TransferRecord> getBaseByBaseinfo( String baseinfoId){
		return dao.getBaseByBaseinfo(baseinfoId);
	}

	/**
	 * @Title:findByClinicId
	 * @Description: （根据门诊主表id查询转诊记录）
	 * @param clinicId
	 * @return
	 * @author WangYQ
	 * @date 2018/04/13
	 * @throws
	 */
	public TransferRecord findByClinicId(String clinicId){
		return dao.findByClinicId(clinicId);
	}


}